﻿@inherits BaseComponent

<div id="@mdId">
    <div id="toc">
        <div><a class="item-title" href="@GetTopLink()" title="@Model?.Title">@Model?.Title</a></div>
    </div>
    <div class="post">
        @CmsUtils.GetMarkdownHtml(Model)
    </div>
</div>
<script>
    $(getTOC('@mdId'));
</script>

@code {
    Guid mdId = Guid.NewGuid();
    string GetTopLink() => Navigation.GetPageUrl().Split('#')[0] + '#' + mdId;

    [Parameter] public IContentInfo Model { get; set; }
}